package com.base.struts2.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

/**
 * <p>基础数据Action<p>
 * <p>包含Request，Response，Session</p>
 * @author Jason
 */
public class BaseAction extends ActionSupport {
	
	private HttpServletRequest request;
	private HttpServletResponse response;
	Map session;
	
	public HttpServletRequest getRequest() {
		return request;
	}

	public HttpServletResponse getResponse() {
		return response;
	}

	public Map getSession() {
		return session;
	}

	public BaseAction() {
		ActionContext ac = ActionContext.getContext();
		request = (HttpServletRequest) ac.get(ServletActionContext.HTTP_REQUEST);
		response = (HttpServletResponse) ac.get(ServletActionContext.HTTP_RESPONSE);
		session = ac.getSession();
	}
	
	@Override
	public String execute() throws Exception {
		return super.SUCCESS;
	}
}
